package com.sgb.kjwl.view.ui.adapter.home;

import android.content.Context;
import android.view.View;

import com.sgb.kjwl.BR;
import com.sgb.kjwl.R;
import com.sgb.kjwl.databinding.ItemHomeSearchGoodsBinding;
import com.sgb.kjwl.databinding.ItemMaterialGoods1Binding;
import com.sgb.kjwl.model.entity.RecommendEntity;
import com.sgb.kjwl.model.entity.SearchMaterialEntity3;
import com.swgk.core.recyclerview.adapter.BaseRecycleAdapter;
import com.swgk.core.recyclerview.adapter.ItemViewHolder;

import java.util.List;

public class SearchNewGoodsAdapter extends BaseRecycleAdapter<RecommendEntity> {

    public SearchNewGoodsAdapter(Context context, List<RecommendEntity> datas) {
        super(context, R.layout.item_home_search_goods, datas);
    }

    @Override
    public void convert(ItemViewHolder holder, final RecommendEntity entity) {
        holder.setBinding(BR.viewModel, entity);
        ItemHomeSearchGoodsBinding goodsBinding = (ItemHomeSearchGoodsBinding) holder.getmBinding();
        if ("1".equals(entity.getSelfSupportTag())) {
            goodsBinding.selfSupport.setVisibility(View.VISIBLE);
        } else {
            goodsBinding.selfSupport.setVisibility(View.GONE);
        }
        goodsBinding.tvStorageName.setText("仓储:" + entity.getStorageName());
    }
}
